/* 文章详情页样式 */

/* 文章详情样式 */
.post-detail {
  padding: 20px 18px;
}

.post-header {
  border-bottom: 1px solid var(--primary);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.post-title-main {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.5;
  word-break: break-word;
}

.post-meta-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.post-tags-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.post-cover-main {
  margin: 0 0 20px;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f0f0;
}

.post-cover-main img {
  width: 100%;
  height: auto;
  display: block;
}

.post-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.post-body p {
  margin: 12px 0;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  margin: 20px 0 12px;
  font-weight: 700;
  color: var(--ink);
}

.post-body h1 {
  font-size: 22px;
}

.post-body h2 {
  font-size: 20px;
}

.post-body h3 {
  font-size: 18px;
}

.post-body h4 {
  font-size: 16px;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}

.post-body ul,
.post-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.post-body li {
  margin: 6px 0;
}

.post-body blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin: 16px 0;
  color: #666;
  font-style: italic;
}

.post-body code {
  background: var(--primary-weak);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--primary);
  font-family: monospace;
}

.post-body pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: var(--ink);
}

.post-body a {
  color: var(--primary);
  text-decoration: none;
}

.post-body a:hover {
  text-decoration: underline;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.post-body th,
.post-body td {
  border: 1px solid #e6eee6;
  padding: 8px 12px;
  text-align: left;
}

.post-body th {
  background: var(--primary-weak);
  font-weight: 700;
}

/* 上一篇/下一篇导航 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.post-nav-item {
  background: #fff;
  border: 1px solid #e6eee6;
  border-radius: 10px;
  overflow: hidden;
  transition: all .2s;
}

.post-nav-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(44, 163, 106, .1);
}

.post-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
}

.post-nav-link.post-nav-empty {
  color: #999;
  cursor: not-allowed;
}

.post-nav-prev .post-nav-link {
  flex-direction: row;
}

.post-nav-next .post-nav-link {
  flex-direction: row-reverse;
  text-align: right;
}

.post-nav-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-weak);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all .2s;
}

.post-nav-link:hover .post-nav-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

.post-nav-content {
  flex: 1;
  min-width: 0;
}

.post-nav-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.post-nav-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
}

.post-nav-link:hover .post-nav-title {
  color: var(--primary);
}

.post-nav-empty .post-nav-title {
  color: #999;
  font-weight: 400;
}

/* 相关文章样式 */
.related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-post-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #e6eee6;
}

.related-post-item:last-child {
  border-bottom: none;
}

.related-post-cover {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.related-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-post-content {
  flex: 1;
  min-width: 0;
}

.related-post-title {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.4;
}

.related-post-title a {
  color: var(--ink);
  font-weight: 600;
}

.related-post-title a:hover {
  color: var(--primary);
}

.related-post-summary {
  font-size: 13px;
  color: #666;
  margin: 4px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}

/* 评论区域样式 */
.comment-form-wrapper {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6eee6;
}

.comment-form-group {
  margin-bottom: 12px;
}

.comment-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e6eee6;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .2s;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 163, 106, .1);
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-form-tip {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #999;
}

#commentReplyTo {
  margin-right: 8px;
}

.btn-cancel-reply {
  display: none;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
  padding: 0;
  transition: color .2s;
}

.btn-cancel-reply:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.btn-submit-comment {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}

.btn-submit-comment:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(44, 163, 106, .2);
}

.btn-submit-comment:active {
  transform: translateY(0);
}

.btn-submit-comment:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* 评论登录提示 */
.comment-login-prompt {
  padding: 30px;
  text-align: center;
  background: var(--primary-weak);
  border-radius: 8px;
  margin-bottom: 20px;
}

.comment-login-prompt p {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 15px;
}

.comment-login-prompt i {
  margin-right: 6px;
  color: var(--primary);
}

.comment-login-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.comment-login-btn {
  padding: 8px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  transition: all .2s;
}

.comment-login-btn-primary {
  background: var(--primary);
  color: #fff;
}

.comment-login-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.comment-login-btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.comment-login-btn-secondary:hover {
  background: var(--primary-weak);
}

/* 评论列表样式 */
.comments-list {
  margin-top: 20px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar-default {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 32px;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.comment-time {
  font-size: 12px;
  color: #999;
}

.comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  word-wrap: break-word;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.comment-actions {
  margin-top: 8px;
}

.btn-reply-comment {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-reply-comment:hover {
  background: var(--primary-weak);
  color: var(--primary);
}

.btn-reply-comment i {
  font-size: 14px;
}

.comment-children {
  margin-top: 16px;
  padding-left: 20px;
  border-left: 2px solid #e6eee6;
}

.comment-children .comment-item {
  padding: 12px 0;
}

.comment-children .comment-avatar {
  width: 32px;
  height: 32px;
}

.comment-children .comment-author {
  font-size: 13px;
}

.comment-children .comment-text {
  font-size: 13px;
}

.comments-empty {
  padding: 40px 20px;
  text-align: center;
}

.comments-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.5;
}

/* 点赞按钮样式 */
.post-like-item {
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.post-like-item:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.post-like-item i {
  font-size: 14px;
  transition: transform .2s;
}

.post-like-item:hover i {
  transform: scale(1.2);
}

.post-like-item[data-loading="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* 收藏按钮样式 */
.post-favorite-item {
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.post-favorite-item:hover {
  color: #ffc107;
  transform: scale(1.1);
}

.post-favorite-item i {
  font-size: 14px;
  transition: transform .2s;
}

.post-favorite-item:hover i {
  transform: scale(1.2);
}

.post-favorite-item[data-loading="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* 卡片头部布局调整 */
.card-hd {
  padding: 16px 18px;
}

.card-hd h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.comment-count {
  font-size: 14px;
  font-weight: 400;
}

/* 相关文章和评论卡片间距 */
.related-posts-card,
.comments-card {
  margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 767.98px) {
  .post-detail {
    padding: 16px 14px;
  }
  
  .post-title-main {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .post-meta-header {
    font-size: 12px;
    gap: 10px;
    margin-bottom: 10px;
  }
  
  .post-header {
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  
  .post-body {
    font-size: 14px;
    line-height: 1.7;
  }
  
  .post-body h1 {
    font-size: 20px;
  }
  
  .post-body h2 {
    font-size: 18px;
  }
  
  .post-body h3 {
    font-size: 16px;
  }
  
  .post-body h4 {
    font-size: 15px;
  }
  
  .post-nav {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }
  
  .post-nav-link {
    padding: 12px;
  }
  
  .post-nav-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .post-nav-title {
    font-size: 13px;
  }
  
  .post-nav-next .post-nav-link {
    flex-direction: row;
    text-align: left;
  }
  
  .related-post-item {
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }
  
  .related-post-cover {
    width: 100%;
    height: 160px;
  }
  
  .related-post-title {
    font-size: 14px;
  }
  
  .related-post-summary {
    font-size: 12px;
  }
  
  .related-post-meta {
    font-size: 11px;
    gap: 10px;
  }
  
  .card-hd {
    padding: 12px 14px;
  }
  
  .card-bd {
    padding: 10px 12px;
  }
  
  .comment-form-wrapper {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  
  .comment-textarea {
    padding: 10px;
    font-size: 14px;
  }
  
  .comment-form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .comment-form-tip {
    flex-wrap: wrap;
  }
  
  .btn-submit-comment {
    width: 100%;
    padding: 10px 20px;
  }
  
  .comment-item {
    padding: 12px 0;
    gap: 10px;
  }
  
  .comment-avatar {
    width: 36px;
    height: 36px;
  }
  
  .comment-author {
    font-size: 13px;
  }
  
  .comment-time {
    font-size: 11px;
  }
  
  .comment-text {
    font-size: 13px;
    line-height: 1.5;
  }
  
  .comment-children {
    padding-left: 12px;
  }
  
  .comment-children .comment-avatar {
    width: 28px;
    height: 28px;
  }
  
  .comment-children .comment-text {
    font-size: 12px;
  }
  
  .comments-empty {
    padding: 30px 15px;
  }
}

@media (max-width: 575.98px) {
  .post-detail {
    padding: 12px 10px;
  }
  
  .post-title-main {
    font-size: 18px;
  }
  
  .post-meta-header {
    font-size: 11px;
    gap: 8px;
  }
  
  .post-body {
    font-size: 13px;
  }
}

/* 移动端卡片内容优化 */
@media (max-width: 767.98px) {
  .post-title {
    font-size: 15px;
    margin-bottom: 6px;
  }
  
  .post-summary {
    font-size: 12px;
    margin: 4px 0;
    line-height: 1.5;
  }
  
  .post-meta {
    font-size: 11px;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
  }
  
  .post-meta-item i {
    font-size: 12px;
  }
  
  .post-tags {
    margin-top: 4px;
    gap: 3px;
  }
  
  .post-tag {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* 侧边栏移动端优化 */
@media (max-width: 991.98px) {
  .col-lg-3 {
    margin-top: 16px;
  }
  
  .col-lg-3 .card {
    margin-bottom: 12px;
  }
  
  .col-lg-3 .card-hd {
    font-size: 15px;
    padding: 10px 12px;
  }
  
  .col-lg-3 .card-bd {
    padding: 10px 12px;
  }
  
  .col-lg-3 .post-card {
    padding: 8px 0;
  }
  
  .col-lg-3 .post-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .col-lg-3 .muted {
    font-size: 12px;
    margin: 0 4px 4px 0;
  }
}

/* 主布局移动端优化 */
@media (max-width: 767.98px) {
  .layout-main .col-lg-9 {
    margin-bottom: 0;
  }
  
  .layout-main .card {
    border-radius: 10px;
    margin-bottom: 12px;
  }
  
  .main.container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

